package com.camel.controller;

import com.camel.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Controller
public class UserController {

    @RequestMapping("/user")
    public String findUser(Model model) {
        List<User> users = new ArrayList<>();
        users.add(new User("张三","123"));
        users.add(new User("李四","123"));

        model.addAttribute("users", users);
        model.addAttribute("hello","hello world");
        model.addAttribute("now",new Date());
        model.addAttribute("num",100);

        return "test";
    }
    @RequestMapping("/a")
    public String a(Model model) {
        return "index";
    }
}

